var e = getApp();

Page({
    data: {
        videoad: "",
        isLogin: 1,
        userInfo: {},
        kefuwx: "ixiaoxingyun520",
        kefutxt: "添加客服微信",
        orderCount: {}
    },
    onLoad: function(e) {
        wx.getStorageSync("wxapp") && this.setData({
            videoad: wx.getStorageSync("wxapp").videoad,
            kefuwx: wx.getStorageSync("wxapp").kefuwx,
            kefutxt: wx.getStorageSync("wxapp").kefutxt
        });
    },
    onShow: function() {},
    copaywx: function() {
        var e = this, t = e.data.kefuwx;
        console.log("kefuwx" + t), t || (t = e.data.kefuwx), wx.setClipboardData({
            data: t,
            success: function(e) {
                wx.showModal({
                    title: "提示",
                    content: "客服微信号已经复制成功，打开微信添加好友吧",
                    showCancel: !1,
                    confirmText: "好的",
                    success: function(e) {}
                });
            }
        });
    },
    getUserDetail: function() {
        var t = this;
        e._get("user.index/detail", {}, function(e) {
            t.setData(e.data);
        });
    },
    onTargetOrder: function(e) {
        if (!this.onCheckLogin()) return !1;
        var t = {
            all: "/pages/order/index?type=all",
            payment: "/pages/order/index?type=payment",
            delivery: "/pages/order/index?type=delivery",
            received: "/pages/order/index?type=received"
        };
        wx.navigateTo({
            url: t[e.currentTarget.dataset.type]
        });
    },
    onTargetMenus: function(e) {
        if (!this.onCheckLogin()) return !1;
        wx.navigateTo({
            url: "/" + e.currentTarget.dataset.url
        });
    },
    onLogin: function() {
        wx.navigateTo({
            url: "../login/login"
        });
    },
    onCheckLogin: function() {
        return !!this.data.isLogin || (e.showError("很抱歉，您还没有登录"), !1);
    }
});